<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MQTT C Client Libraries Internals: Socket.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="pahologo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MQTT C Client Libraries Internals
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">Socket.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Socket related functions.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;Socket.h&quot;</code><br />
<code>#include &quot;Log.h&quot;</code><br />
<code>#include &quot;SocketBuffer.h&quot;</code><br />
<code>#include &quot;Messages.h&quot;</code><br />
<code>#include &quot;StackTrace.h&quot;</code><br />
<code>#include &lt;stdlib.h&gt;</code><br />
<code>#include &lt;string.h&gt;</code><br />
<code>#include &lt;signal.h&gt;</code><br />
<code>#include &lt;ctype.h&gt;</code><br />
<code>#include &quot;Heap.h&quot;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for Socket.c:</div>
<div class="dyncontent">
<div class="center"><img src="Socket_8c__incl.png" border="0" usemap="#Socket_8c" alt=""/></div>
<map name="Socket_8c" id="Socket_8c">
<area shape="rect" title="Socket related functions." alt="" coords="132,5,205,32"/>
<area shape="rect" title=" " alt="" coords="5,80,68,107"/>
<area shape="rect" title=" " alt="" coords="93,80,157,107"/>
<area shape="rect" title=" " alt="" coords="181,80,247,107"/>
<area shape="rect" title=" " alt="" coords="272,80,335,107"/>
</map>
</div>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a6d5639d1b3a0ddfb2d1bbe55e043f47e"><td class="memItemLeft" align="right" valign="top"><a id="a6d5639d1b3a0ddfb2d1bbe55e043f47e"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>ADDRLEN</b>&#160;&#160;&#160;INET6_ADDRSTRLEN+1</td></tr>
<tr class="separator:a6d5639d1b3a0ddfb2d1bbe55e043f47e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ae5ce8741a047dab326de1cb98ae28d"><td class="memItemLeft" align="right" valign="top"><a id="a1ae5ce8741a047dab326de1cb98ae28d"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>PORTLEN</b>&#160;&#160;&#160;10</td></tr>
<tr class="separator:a1ae5ce8741a047dab326de1cb98ae28d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a90f49db5a5763c6874f27facfe9e60a3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#a90f49db5a5763c6874f27facfe9e60a3">Socket_setnonblocking</a> (int sock)</td></tr>
<tr class="memdesc:a90f49db5a5763c6874f27facfe9e60a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set a socket non-blocking, OS independently.  <a href="Socket_8c.html#a90f49db5a5763c6874f27facfe9e60a3">More...</a><br /></td></tr>
<tr class="separator:a90f49db5a5763c6874f27facfe9e60a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47824ad5afba267b9488150e1f7e8610"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#a47824ad5afba267b9488150e1f7e8610">Socket_error</a> (char *aString, int sock)</td></tr>
<tr class="memdesc:a47824ad5afba267b9488150e1f7e8610"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the specific error corresponding to SOCKET_ERROR.  <a href="Socket_8c.html#a47824ad5afba267b9488150e1f7e8610">More...</a><br /></td></tr>
<tr class="separator:a47824ad5afba267b9488150e1f7e8610"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c690a1d23a55ccf1ea52cdea9b56432"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#a3c690a1d23a55ccf1ea52cdea9b56432">Socket_addSocket</a> (int newSd)</td></tr>
<tr class="memdesc:a3c690a1d23a55ccf1ea52cdea9b56432"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a socket to the list of socket to check with select.  <a href="Socket_8c.html#a3c690a1d23a55ccf1ea52cdea9b56432">More...</a><br /></td></tr>
<tr class="separator:a3c690a1d23a55ccf1ea52cdea9b56432"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeec7592039c180d20ef7c6e8f50d5667"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#aeec7592039c180d20ef7c6e8f50d5667">isReady</a> (int socket, fd_set *read_set, fd_set *write_set)</td></tr>
<tr class="memdesc:aeec7592039c180d20ef7c6e8f50d5667"><td class="mdescLeft">&#160;</td><td class="mdescRight">Don't accept work from a client unless it is accepting work back, i.e.  <a href="Socket_8c.html#aeec7592039c180d20ef7c6e8f50d5667">More...</a><br /></td></tr>
<tr class="separator:aeec7592039c180d20ef7c6e8f50d5667"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec4ee8ecb248d29d315d2624a88ed1c3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#aec4ee8ecb248d29d315d2624a88ed1c3">Socket_writev</a> (int socket, iobuf *iovecs, int count, unsigned long *<a class="el" href="utf-8_8c.html#acce1763ab1d2658c7e6593c128565303">bytes</a>)</td></tr>
<tr class="memdesc:aec4ee8ecb248d29d315d2624a88ed1c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Attempts to write a series of iovec buffers to a socket in <em>one</em> system call so that they are sent as one packet.  <a href="Socket_8c.html#aec4ee8ecb248d29d315d2624a88ed1c3">More...</a><br /></td></tr>
<tr class="separator:aec4ee8ecb248d29d315d2624a88ed1c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2e7c21836cd061947d6d6e28446c4a59"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#a2e7c21836cd061947d6d6e28446c4a59">Socket_close_only</a> (int socket)</td></tr>
<tr class="memdesc:a2e7c21836cd061947d6d6e28446c4a59"><td class="mdescLeft">&#160;</td><td class="mdescRight">Close a socket without removing it from the select list.  <a href="Socket_8c.html#a2e7c21836cd061947d6d6e28446c4a59">More...</a><br /></td></tr>
<tr class="separator:a2e7c21836cd061947d6d6e28446c4a59"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5ce31969f49786ef8452e2b547527578"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#a5ce31969f49786ef8452e2b547527578">Socket_continueWrite</a> (int socket)</td></tr>
<tr class="memdesc:a5ce31969f49786ef8452e2b547527578"><td class="mdescLeft">&#160;</td><td class="mdescRight">Continue an outstanding write for a particular socket.  <a href="Socket_8c.html#a5ce31969f49786ef8452e2b547527578">More...</a><br /></td></tr>
<tr class="separator:a5ce31969f49786ef8452e2b547527578"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40f45b094eb70875e06f96164afc4a49"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#a40f45b094eb70875e06f96164afc4a49">Socket_continueWrites</a> (fd_set *pwset, int *sock)</td></tr>
<tr class="memdesc:a40f45b094eb70875e06f96164afc4a49"><td class="mdescLeft">&#160;</td><td class="mdescRight">Continue any outstanding writes for a socket set.  <a href="Socket_8c.html#a40f45b094eb70875e06f96164afc4a49">More...</a><br /></td></tr>
<tr class="separator:a40f45b094eb70875e06f96164afc4a49"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a22feda106732e755b6f9e44e026bd261"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#a22feda106732e755b6f9e44e026bd261">Socket_getaddrname</a> (struct sockaddr *sa, int sock)</td></tr>
<tr class="memdesc:a22feda106732e755b6f9e44e026bd261"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert a numeric address to character string.  <a href="Socket_8c.html#a22feda106732e755b6f9e44e026bd261">More...</a><br /></td></tr>
<tr class="separator:a22feda106732e755b6f9e44e026bd261"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad246851be3980fd316d16864a786c808"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#ad246851be3980fd316d16864a786c808">Socket_abortWrite</a> (int socket)</td></tr>
<tr class="memdesc:ad246851be3980fd316d16864a786c808"><td class="mdescLeft">&#160;</td><td class="mdescRight">Continue an outstanding write for a particular socket.  <a href="Socket_8c.html#ad246851be3980fd316d16864a786c808">More...</a><br /></td></tr>
<tr class="separator:ad246851be3980fd316d16864a786c808"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a573a6eea727016f3e8770f60e5eed958"><td class="memItemLeft" align="right" valign="top"><a id="a573a6eea727016f3e8770f60e5eed958"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#a573a6eea727016f3e8770f60e5eed958">Socket_outInitialize</a> (void)</td></tr>
<tr class="memdesc:a573a6eea727016f3e8770f60e5eed958"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the socket module. <br /></td></tr>
<tr class="separator:a573a6eea727016f3e8770f60e5eed958"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af365aa1d5a29ffcb83bb15edaf3401e6"><td class="memItemLeft" align="right" valign="top"><a id="af365aa1d5a29ffcb83bb15edaf3401e6"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#af365aa1d5a29ffcb83bb15edaf3401e6">Socket_outTerminate</a> (void)</td></tr>
<tr class="memdesc:af365aa1d5a29ffcb83bb15edaf3401e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Terminate the socket module. <br /></td></tr>
<tr class="separator:af365aa1d5a29ffcb83bb15edaf3401e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2c082b4e794c0a7835a0700f0bc7b3a1"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#a2c082b4e794c0a7835a0700f0bc7b3a1">Socket_getReadySocket</a> (int more_work, struct timeval *tp, mutex_type mutex, int *rc)</td></tr>
<tr class="memdesc:a2c082b4e794c0a7835a0700f0bc7b3a1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the next socket ready for communications as indicated by select.  <a href="Socket_8c.html#a2c082b4e794c0a7835a0700f0bc7b3a1">More...</a><br /></td></tr>
<tr class="separator:a2c082b4e794c0a7835a0700f0bc7b3a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9af02601f6b5ef066ba99d9498a024b8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#a9af02601f6b5ef066ba99d9498a024b8">Socket_getch</a> (int socket, char *c)</td></tr>
<tr class="memdesc:a9af02601f6b5ef066ba99d9498a024b8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads one byte from a socket.  <a href="Socket_8c.html#a9af02601f6b5ef066ba99d9498a024b8">More...</a><br /></td></tr>
<tr class="separator:a9af02601f6b5ef066ba99d9498a024b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e05161f70e828e8bd06ead38e0be6c8"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#a6e05161f70e828e8bd06ead38e0be6c8">Socket_getdata</a> (int socket, size_t <a class="el" href="utf-8_8c.html#acce1763ab1d2658c7e6593c128565303">bytes</a>, size_t *actual_len, int *rc)</td></tr>
<tr class="memdesc:a6e05161f70e828e8bd06ead38e0be6c8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Attempts to read a number of bytes from a socket, non-blocking.  <a href="Socket_8c.html#a6e05161f70e828e8bd06ead38e0be6c8">More...</a><br /></td></tr>
<tr class="separator:a6e05161f70e828e8bd06ead38e0be6c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae95673b434f2c489ecefe4688c80be2d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#ae95673b434f2c489ecefe4688c80be2d">Socket_noPendingWrites</a> (int socket)</td></tr>
<tr class="memdesc:ae95673b434f2c489ecefe4688c80be2d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Indicate whether any data is pending outbound for a socket.  <a href="Socket_8c.html#ae95673b434f2c489ecefe4688c80be2d">More...</a><br /></td></tr>
<tr class="separator:ae95673b434f2c489ecefe4688c80be2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a601ba77d9b01e908dbd0653f6efa3be0"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#a601ba77d9b01e908dbd0653f6efa3be0">Socket_putdatas</a> (int socket, char *buf0, size_t buf0len, <a class="el" href="structPacketBuffers.html">PacketBuffers</a> bufs)</td></tr>
<tr class="memdesc:a601ba77d9b01e908dbd0653f6efa3be0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Attempts to write a series of buffers to a socket in <em>one</em> system call so that they are sent as one packet.  <a href="Socket_8c.html#a601ba77d9b01e908dbd0653f6efa3be0">More...</a><br /></td></tr>
<tr class="separator:a601ba77d9b01e908dbd0653f6efa3be0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ba07ed0157d93bde9db6483b4bb4d67"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#a8ba07ed0157d93bde9db6483b4bb4d67">Socket_addPendingWrite</a> (int socket)</td></tr>
<tr class="memdesc:a8ba07ed0157d93bde9db6483b4bb4d67"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a socket to the pending write list, so that it is checked for writing in select.  <a href="Socket_8c.html#a8ba07ed0157d93bde9db6483b4bb4d67">More...</a><br /></td></tr>
<tr class="separator:a8ba07ed0157d93bde9db6483b4bb4d67"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0cf9d34480e63e2d6eaaaff09e3fddf7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#a0cf9d34480e63e2d6eaaaff09e3fddf7">Socket_clearPendingWrite</a> (int socket)</td></tr>
<tr class="memdesc:a0cf9d34480e63e2d6eaaaff09e3fddf7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear a socket from the pending write list - if one was added with Socket_addPendingWrite.  <a href="Socket_8c.html#a0cf9d34480e63e2d6eaaaff09e3fddf7">More...</a><br /></td></tr>
<tr class="separator:a0cf9d34480e63e2d6eaaaff09e3fddf7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6bdb051c5944e1a0fd16ba18544ab5df"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#a6bdb051c5944e1a0fd16ba18544ab5df">Socket_close</a> (int socket)</td></tr>
<tr class="memdesc:a6bdb051c5944e1a0fd16ba18544ab5df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Close a socket and remove it from the select list.  <a href="Socket_8c.html#a6bdb051c5944e1a0fd16ba18544ab5df">More...</a><br /></td></tr>
<tr class="separator:a6bdb051c5944e1a0fd16ba18544ab5df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acb965ef2124fa6736477c9286f7599b2"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#acb965ef2124fa6736477c9286f7599b2">Socket_new</a> (const char *addr, size_t addr_len, int port, int *sock)</td></tr>
<tr class="memdesc:acb965ef2124fa6736477c9286f7599b2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new socket and TCP connect to an address/port.  <a href="Socket_8c.html#acb965ef2124fa6736477c9286f7599b2">More...</a><br /></td></tr>
<tr class="separator:acb965ef2124fa6736477c9286f7599b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab053509afada9798dcaf8adaf16e1a59"><td class="memItemLeft" align="right" valign="top"><a id="ab053509afada9798dcaf8adaf16e1a59"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>Socket_setWriteCompleteCallback</b> (Socket_writeComplete *mywritecomplete)</td></tr>
<tr class="separator:ab053509afada9798dcaf8adaf16e1a59"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27952bf5cd133a873da9a218c7207059"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#a27952bf5cd133a873da9a218c7207059">Socket_getpeer</a> (int sock)</td></tr>
<tr class="memdesc:a27952bf5cd133a873da9a218c7207059"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get information about the other end connected to a socket.  <a href="Socket_8c.html#a27952bf5cd133a873da9a218c7207059">More...</a><br /></td></tr>
<tr class="separator:a27952bf5cd133a873da9a218c7207059"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a6caeed4a8d4f884c57a815034cee275e"><td class="memItemLeft" align="right" valign="top"><a id="a6caeed4a8d4f884c57a815034cee275e"></a>
<a class="el" href="structSockets.html">Sockets</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Socket_8c.html#a6caeed4a8d4f884c57a815034cee275e">mod_s</a></td></tr>
<tr class="memdesc:a6caeed4a8d4f884c57a815034cee275e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Structure to hold all socket data for this module. <br /></td></tr>
<tr class="separator:a6caeed4a8d4f884c57a815034cee275e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5ffa4dbe0f377731d9f86fffd6ea4555"><td class="memItemLeft" align="right" valign="top"><a id="a5ffa4dbe0f377731d9f86fffd6ea4555"></a>
static fd_set&#160;</td><td class="memItemRight" valign="bottom"><b>wset</b></td></tr>
<tr class="separator:a5ffa4dbe0f377731d9f86fffd6ea4555"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a98a7c7aa7a0e8abdf3141bf829bab8de"><td class="memItemLeft" align="right" valign="top"><a id="a98a7c7aa7a0e8abdf3141bf829bab8de"></a>
static Socket_writeComplete *&#160;</td><td class="memItemRight" valign="bottom"><b>writecomplete</b> = NULL</td></tr>
<tr class="separator:a98a7c7aa7a0e8abdf3141bf829bab8de"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Socket related functions. </p>
<p>Some other related functions are in the SocketBuffer module </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="aeec7592039c180d20ef7c6e8f50d5667"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeec7592039c180d20ef7c6e8f50d5667">&#9670;&nbsp;</a></span>isReady()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int isReady </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>socket</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">fd_set *&#160;</td>
          <td class="paramname"><em>read_set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">fd_set *&#160;</td>
          <td class="paramname"><em>write_set</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Don't accept work from a client unless it is accepting work back, i.e. </p>
<p>its socket is writeable this seems like a reasonable form of flow control, and practically, seems to work. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>the socket to check </td></tr>
    <tr><td class="paramname">read_set</td><td>the socket read set (see select doc) </td></tr>
    <tr><td class="paramname">write_set</td><td>the socket write set (see select doc) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>boolean - is the socket ready to go? </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="Socket_8c_aeec7592039c180d20ef7c6e8f50d5667_cgraph.png" border="0" usemap="#Socket_8c_aeec7592039c180d20ef7c6e8f50d5667_cgraph" alt=""/></div>
<map name="Socket_8c_aeec7592039c180d20ef7c6e8f50d5667_cgraph" id="Socket_8c_aeec7592039c180d20ef7c6e8f50d5667_cgraph">
<area shape="rect" title="Don&#39;t accept work from a client unless it is accepting work back, i.e." alt="" coords="5,81,73,108"/>
<area shape="rect" href="LinkedList_8c.html#a1738915a6d6f10022e9ee1481c0ae452" title="List callback function for comparing integers." alt="" coords="337,56,424,83"/>
<area shape="rect" href="LinkedList_8c.html#acad319e9ce896ff1fff30ddbeb06d22d" title="Finds an element in a list by comparing the content or pointer to the content." alt="" coords="472,107,567,133"/>
<area shape="rect" href="LinkedList_8c.html#a4bb7c34fe9a5832d65f530091e0fad0d" title="Removes and frees an element in a list by comparing the content." alt="" coords="146,157,265,184"/>
<area shape="rect" href="Socket_8c.html#ae95673b434f2c489ecefe4688c80be2d" title="Indicate whether any data is pending outbound for a socket." alt="" coords="121,5,289,32"/>
<area shape="rect" href="LinkedList_8c.html#a7c6fba7f4b569c69829676bed2852ee9" title="Forward iteration through a list." alt="" coords="615,107,733,133"/>
<area shape="rect" href="LinkedList_8c.html#ab82181e0c1d96954f82dee67cee41296" title="Removes and optionally frees an element in a list by comparing the content." alt="" coords="340,157,421,184"/>
</map>
</div>

</div>
</div>
<a id="ad246851be3980fd316d16864a786c808"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad246851be3980fd316d16864a786c808">&#9670;&nbsp;</a></span>Socket_abortWrite()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Socket_abortWrite </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>socket</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Continue an outstanding write for a particular socket. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>that socket </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>completion code: 0=incomplete, 1=complete, -1=socket error </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="Socket_8c_ad246851be3980fd316d16864a786c808_cgraph.png" border="0" usemap="#Socket_8c_ad246851be3980fd316d16864a786c808_cgraph" alt=""/></div>
<map name="Socket_8c_ad246851be3980fd316d16864a786c808_cgraph" id="Socket_8c_ad246851be3980fd316d16864a786c808_cgraph">
<area shape="rect" title="Continue an outstanding write for a particular socket." alt="" coords="5,31,135,57"/>
<area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="237,5,281,32"/>
<area shape="rect" href="SocketBuffer_8c.html#a5f22a1ac450cb1805e2ab8f2ae3da80e" title="Get any queued write data for a specific socket." alt="" coords="183,56,335,83"/>
<area shape="rect" href="LinkedList_8c.html#acad319e9ce896ff1fff30ddbeb06d22d" title="Finds an element in a list by comparing the content or pointer to the content." alt="" coords="417,31,511,57"/>
<area shape="rect" href="SocketBuffer_8c.html#a39f1ee9c98bc12a7be4d7a40b03550d5" title="List callback function for comparing pending_writes by socket." alt="" coords="383,81,545,108"/>
<area shape="rect" href="LinkedList_8c.html#a7c6fba7f4b569c69829676bed2852ee9" title="Forward iteration through a list." alt="" coords="593,31,712,57"/>
</map>
</div>

</div>
</div>
<a id="a8ba07ed0157d93bde9db6483b4bb4d67"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8ba07ed0157d93bde9db6483b4bb4d67">&#9670;&nbsp;</a></span>Socket_addPendingWrite()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Socket_addPendingWrite </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>socket</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Add a socket to the pending write list, so that it is checked for writing in select. </p>
<p>This is used in connect processing when the TCP connect is incomplete, as we need to check the socket for both ready to read and write states. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>the socket to add </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a3c690a1d23a55ccf1ea52cdea9b56432"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3c690a1d23a55ccf1ea52cdea9b56432">&#9670;&nbsp;</a></span>Socket_addSocket()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Socket_addSocket </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>newSd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Add a socket to the list of socket to check with select. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">newSd</td><td>the new socket to add </td></tr>
  </table>
  </dd>
</dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="Socket_8c_a3c690a1d23a55ccf1ea52cdea9b56432_cgraph.png" border="0" usemap="#Socket_8c_a3c690a1d23a55ccf1ea52cdea9b56432_cgraph" alt=""/></div>
<map name="Socket_8c_a3c690a1d23a55ccf1ea52cdea9b56432_cgraph" id="Socket_8c_a3c690a1d23a55ccf1ea52cdea9b56432_cgraph">
<area shape="rect" title="Add a socket to the list of socket to check with select." alt="" coords="5,81,137,108"/>
<area shape="rect" href="LinkedList_8c.html#a1738915a6d6f10022e9ee1481c0ae452" title="List callback function for comparing integers." alt="" coords="189,5,276,32"/>
<area shape="rect" href="LinkedList_8c.html#abc7a28449893dfa775c2f709349968b4" title="Append an item to a list." alt="" coords="189,56,277,83"/>
<area shape="rect" href="LinkedList_8c.html#acad319e9ce896ff1fff30ddbeb06d22d" title="Finds an element in a list by comparing the content or pointer to the content." alt="" coords="185,107,280,133"/>
<area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="211,157,255,184"/>
<area shape="rect" href="LinkedList_8c.html#a321a3598d6979c7af3f995b77ea2cec3" title="Append an already allocated ListElement and content to a list." alt="" coords="328,56,471,83"/>
<area shape="rect" href="LinkedList_8c.html#a7c6fba7f4b569c69829676bed2852ee9" title="Forward iteration through a list." alt="" coords="340,107,459,133"/>
</map>
</div>

</div>
</div>
<a id="a0cf9d34480e63e2d6eaaaff09e3fddf7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0cf9d34480e63e2d6eaaaff09e3fddf7">&#9670;&nbsp;</a></span>Socket_clearPendingWrite()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Socket_clearPendingWrite </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>socket</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Clear a socket from the pending write list - if one was added with Socket_addPendingWrite. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>the socket to remove </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a6bdb051c5944e1a0fd16ba18544ab5df"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6bdb051c5944e1a0fd16ba18544ab5df">&#9670;&nbsp;</a></span>Socket_close()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Socket_close </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>socket</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Close a socket and remove it from the select list. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>the socket to close </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>completion code </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="Socket_8c_a6bdb051c5944e1a0fd16ba18544ab5df_cgraph.png" border="0" usemap="#Socket_8c_a6bdb051c5944e1a0fd16ba18544ab5df_cgraph" alt=""/></div>
<map name="Socket_8c_a6bdb051c5944e1a0fd16ba18544ab5df_cgraph" id="Socket_8c_a6bdb051c5944e1a0fd16ba18544ab5df_cgraph">
<area shape="rect" title="Close a socket and remove it from the select list." alt="" coords="5,233,107,260"/>
<area shape="rect" href="LinkedList_8c.html#a1738915a6d6f10022e9ee1481c0ae452" title="List callback function for comparing integers." alt="" coords="186,5,273,32"/>
<area shape="rect" href="LinkedList_8c.html#a7c6fba7f4b569c69829676bed2852ee9" title="Forward iteration through a list." alt="" coords="1069,107,1188,133"/>
<area shape="rect" href="LinkedList_8c.html#a4bb7c34fe9a5832d65f530091e0fad0d" title="Removes and frees an element in a list by comparing the content." alt="" coords="609,233,727,260"/>
<area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="646,461,690,488"/>
<area shape="rect" href="Socket_8c.html#ad246851be3980fd316d16864a786c808" title="Continue an outstanding write for a particular socket." alt="" coords="165,360,294,387"/>
<area shape="rect" href="Socket_8c.html#a2e7c21836cd061947d6d6e28446c4a59" title="Close a socket without removing it from the select list." alt="" coords="164,436,295,463"/>
<area shape="rect" href="SocketBuffer_8c.html#a0601e12cab5b7c4777df10ca6d38a41b" title="Cleanup any buffers for a specific socket." alt="" coords="155,233,304,260"/>
<area shape="rect" href="LinkedList_8c.html#ab82181e0c1d96954f82dee67cee41296" title="Removes and optionally frees an element in a list by comparing the content." alt="" coords="797,183,879,209"/>
<area shape="rect" href="LinkedList_8c.html#acad319e9ce896ff1fff30ddbeb06d22d" title="Finds an element in a list by comparing the content or pointer to the content." alt="" coords="927,132,1021,159"/>
<area shape="rect" href="SocketBuffer_8c.html#a5f22a1ac450cb1805e2ab8f2ae3da80e" title="Get any queued write data for a specific socket." alt="" coords="369,360,521,387"/>
<area shape="rect" href="SocketBuffer_8c.html#a39f1ee9c98bc12a7be4d7a40b03550d5" title="List callback function for comparing pending_writes by socket." alt="" coords="587,309,749,336"/>
<area shape="rect" href="Socket_8c.html#a47824ad5afba267b9488150e1f7e8610" title="Gets the specific error corresponding to SOCKET_ERROR." alt="" coords="397,461,493,488"/>
<area shape="rect" href="LinkedList_8c.html#a8430370b2b15c56ec95bb8e7e36753a5" title="Removes and frees an item in a list by comparing the pointer to the content." alt="" coords="622,183,714,209"/>
<area shape="rect" href="SocketBuffer_8c.html#a893ce45cf77f7d66c3f27c831ccf8124" title="A socket write has now completed so we can get rid of the queue." alt="" coords="352,309,539,336"/>
<area shape="rect" href="SocketBuffer_8c.html#acebc1cbb93be4588f33b04ed404f6dbf" title="List callback function for comparing socket_queues by socket." alt="" coords="390,208,501,235"/>
</map>
</div>

</div>
</div>
<a id="a2e7c21836cd061947d6d6e28446c4a59"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2e7c21836cd061947d6d6e28446c4a59">&#9670;&nbsp;</a></span>Socket_close_only()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Socket_close_only </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>socket</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Close a socket without removing it from the select list. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>the socket to close </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>completion code </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="Socket_8c_a2e7c21836cd061947d6d6e28446c4a59_cgraph.png" border="0" usemap="#Socket_8c_a2e7c21836cd061947d6d6e28446c4a59_cgraph" alt=""/></div>
<map name="Socket_8c_a2e7c21836cd061947d6d6e28446c4a59_cgraph" id="Socket_8c_a2e7c21836cd061947d6d6e28446c4a59_cgraph">
<area shape="rect" title="Close a socket without removing it from the select list." alt="" coords="5,5,136,32"/>
<area shape="rect" href="Socket_8c.html#a47824ad5afba267b9488150e1f7e8610" title="Gets the specific error corresponding to SOCKET_ERROR." alt="" coords="184,5,280,32"/>
<area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="328,5,372,32"/>
</map>
</div>

</div>
</div>
<a id="a5ce31969f49786ef8452e2b547527578"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5ce31969f49786ef8452e2b547527578">&#9670;&nbsp;</a></span>Socket_continueWrite()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Socket_continueWrite </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>socket</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Continue an outstanding write for a particular socket. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>that socket </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>completion code: 0=incomplete, 1=complete, -1=socket error </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="Socket_8c_a5ce31969f49786ef8452e2b547527578_cgraph.png" border="0" usemap="#Socket_8c_a5ce31969f49786ef8452e2b547527578_cgraph" alt=""/></div>
<map name="Socket_8c_a5ce31969f49786ef8452e2b547527578_cgraph" id="Socket_8c_a5ce31969f49786ef8452e2b547527578_cgraph">
<area shape="rect" title="Continue an outstanding write for a particular socket." alt="" coords="5,31,155,57"/>
<area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="651,5,695,32"/>
<area shape="rect" href="Socket_8c.html#aec4ee8ecb248d29d315d2624a88ed1c3" title="Attempts to write a series of iovec buffers to a socket in one system call so that they are sent as o..." alt="" coords="226,31,331,57"/>
<area shape="rect" href="SocketBuffer_8c.html#a5f22a1ac450cb1805e2ab8f2ae3da80e" title="Get any queued write data for a specific socket." alt="" coords="203,81,355,108"/>
<area shape="rect" href="Socket_8c.html#a47824ad5afba267b9488150e1f7e8610" title="Gets the specific error corresponding to SOCKET_ERROR." alt="" coords="436,31,532,57"/>
<area shape="rect" href="LinkedList_8c.html#acad319e9ce896ff1fff30ddbeb06d22d" title="Finds an element in a list by comparing the content or pointer to the content." alt="" coords="437,81,531,108"/>
<area shape="rect" href="SocketBuffer_8c.html#a39f1ee9c98bc12a7be4d7a40b03550d5" title="List callback function for comparing pending_writes by socket." alt="" coords="403,132,565,159"/>
<area shape="rect" href="LinkedList_8c.html#a7c6fba7f4b569c69829676bed2852ee9" title="Forward iteration through a list." alt="" coords="613,81,732,108"/>
</map>
</div>

</div>
</div>
<a id="a40f45b094eb70875e06f96164afc4a49"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a40f45b094eb70875e06f96164afc4a49">&#9670;&nbsp;</a></span>Socket_continueWrites()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Socket_continueWrites </td>
          <td>(</td>
          <td class="paramtype">fd_set *&#160;</td>
          <td class="paramname"><em>pwset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>sock</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Continue any outstanding writes for a socket set. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pwset</td><td>the set of sockets </td></tr>
    <tr><td class="paramname">sock</td><td>in case of a socket error contains the affected socket </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>completion code, 0 or SOCKET_ERROR </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="Socket_8c_a40f45b094eb70875e06f96164afc4a49_cgraph.png" border="0" usemap="#Socket_8c_a40f45b094eb70875e06f96164afc4a49_cgraph" alt=""/></div>
<map name="Socket_8c_a40f45b094eb70875e06f96164afc4a49_cgraph" id="Socket_8c_a40f45b094eb70875e06f96164afc4a49_cgraph">
<area shape="rect" title="Continue any outstanding writes for a socket set." alt="" coords="5,183,161,209"/>
<area shape="rect" href="LinkedList_8c.html#a7c6fba7f4b569c69829676bed2852ee9" title="Forward iteration through a list." alt="" coords="997,233,1116,260"/>
<area shape="rect" href="LinkedList_8c.html#a8430370b2b15c56ec95bb8e7e36753a5" title="Removes and frees an item in a list by comparing the pointer to the content." alt="" coords="257,5,349,32"/>
<area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="880,233,924,260"/>
<area shape="rect" href="Socket_8c.html#a5ce31969f49786ef8452e2b547527578" title="Continue an outstanding write for a particular socket." alt="" coords="228,183,377,209"/>
<area shape="rect" href="SocketBuffer_8c.html#a893ce45cf77f7d66c3f27c831ccf8124" title="A socket write has now completed so we can get rid of the queue." alt="" coords="209,81,396,108"/>
<area shape="rect" href="LinkedList_8c.html#ab82181e0c1d96954f82dee67cee41296" title="Removes and optionally frees an element in a list by comparing the content." alt="" coords="685,31,766,57"/>
<area shape="rect" href="LinkedList_8c.html#acad319e9ce896ff1fff30ddbeb06d22d" title="Finds an element in a list by comparing the content or pointer to the content." alt="" coords="855,132,949,159"/>
<area shape="rect" href="Socket_8c.html#aec4ee8ecb248d29d315d2624a88ed1c3" title="Attempts to write a series of iovec buffers to a socket in one system call so that they are sent as o..." alt="" coords="467,183,573,209"/>
<area shape="rect" href="SocketBuffer_8c.html#a5f22a1ac450cb1805e2ab8f2ae3da80e" title="Get any queued write data for a specific socket." alt="" coords="444,132,596,159"/>
<area shape="rect" href="Socket_8c.html#a47824ad5afba267b9488150e1f7e8610" title="Gets the specific error corresponding to SOCKET_ERROR." alt="" coords="677,183,773,209"/>
<area shape="rect" href="SocketBuffer_8c.html#a39f1ee9c98bc12a7be4d7a40b03550d5" title="List callback function for comparing pending_writes by socket." alt="" coords="644,81,807,108"/>
<area shape="rect" href="LinkedList_8c.html#a4bb7c34fe9a5832d65f530091e0fad0d" title="Removes and frees an element in a list by comparing the content." alt="" coords="461,31,579,57"/>
</map>
</div>

</div>
</div>
<a id="a47824ad5afba267b9488150e1f7e8610"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a47824ad5afba267b9488150e1f7e8610">&#9670;&nbsp;</a></span>Socket_error()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Socket_error </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>aString</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>sock</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the specific error corresponding to SOCKET_ERROR. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">aString</td><td>the function that was being used when the error occurred </td></tr>
    <tr><td class="paramname">sock</td><td>the socket on which the error occurred </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the specific TCP error code </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="Socket_8c_a47824ad5afba267b9488150e1f7e8610_cgraph.png" border="0" usemap="#Socket_8c_a47824ad5afba267b9488150e1f7e8610_cgraph" alt=""/></div>
<map name="Socket_8c_a47824ad5afba267b9488150e1f7e8610_cgraph" id="Socket_8c_a47824ad5afba267b9488150e1f7e8610_cgraph">
<area shape="rect" title="Gets the specific error corresponding to SOCKET_ERROR." alt="" coords="5,5,101,32"/>
<area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="149,5,193,32"/>
</map>
</div>

</div>
</div>
<a id="a22feda106732e755b6f9e44e026bd261"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a22feda106732e755b6f9e44e026bd261">&#9670;&nbsp;</a></span>Socket_getaddrname()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char * Socket_getaddrname </td>
          <td>(</td>
          <td class="paramtype">struct sockaddr *&#160;</td>
          <td class="paramname"><em>sa</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>sock</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Convert a numeric address to character string. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sa</td><td>socket numerical address </td></tr>
    <tr><td class="paramname">sock</td><td>socket </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the peer information </dd></dl>
<p>maximum length of the address string</p>
<p>maximum length of the port string</p>

</div>
</div>
<a id="a9af02601f6b5ef066ba99d9498a024b8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9af02601f6b5ef066ba99d9498a024b8">&#9670;&nbsp;</a></span>Socket_getch()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Socket_getch </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>socket</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>c</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reads one byte from a socket. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>the socket to read from </td></tr>
    <tr><td class="paramname">c</td><td>the character read, returned </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>completion code </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="Socket_8c_a9af02601f6b5ef066ba99d9498a024b8_cgraph.png" border="0" usemap="#Socket_8c_a9af02601f6b5ef066ba99d9498a024b8_cgraph" alt=""/></div>
<map name="Socket_8c_a9af02601f6b5ef066ba99d9498a024b8_cgraph" id="Socket_8c_a9af02601f6b5ef066ba99d9498a024b8_cgraph">
<area shape="rect" title="Reads one byte from a socket." alt="" coords="5,81,108,108"/>
<area shape="rect" href="Socket_8c.html#a47824ad5afba267b9488150e1f7e8610" title="Gets the specific error corresponding to SOCKET_ERROR." alt="" coords="205,5,301,32"/>
<area shape="rect" href="SocketBuffer_8c.html#a08102e2e43746ccd1ab26739b5841a7c" title="Get any queued character for a specific socket." alt="" coords="156,56,351,83"/>
<area shape="rect" href="SocketBuffer_8c.html#aaac8b43c1ab5d20eb8e6b95de6e80671" title="A socket read was interrupted so we need to queue data." alt="" coords="171,157,336,184"/>
<area shape="rect" href="SocketBuffer_8c.html#a8a94cbb0db8ba0834a7f1c6e2eb938b4" title="Queued a Charactor to a specific socket." alt="" coords="170,107,337,133"/>
<area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="456,5,500,32"/>
<area shape="rect" href="LinkedList_8c.html#acad319e9ce896ff1fff30ddbeb06d22d" title="Finds an element in a list by comparing the content or pointer to the content." alt="" coords="431,107,525,133"/>
<area shape="rect" href="SocketBuffer_8c.html#acebc1cbb93be4588f33b04ed404f6dbf" title="List callback function for comparing socket_queues by socket." alt="" coords="423,56,533,83"/>
<area shape="rect" href="LinkedList_8c.html#a7c6fba7f4b569c69829676bed2852ee9" title="Forward iteration through a list." alt="" coords="617,107,736,133"/>
<area shape="rect" href="LinkedList_8c.html#abc7a28449893dfa775c2f709349968b4" title="Append an item to a list." alt="" coords="434,208,522,235"/>
<area shape="rect" href="SocketBuffer_8c.html#a9293d4ef45aa2a51baab9be4eb73091b" title="Create a new default queue when one has just been used." alt="" coords="399,157,557,184"/>
<area shape="rect" href="LinkedList_8c.html#a321a3598d6979c7af3f995b77ea2cec3" title="Append an already allocated ListElement and content to a list." alt="" coords="605,208,748,235"/>
</map>
</div>

</div>
</div>
<a id="a6e05161f70e828e8bd06ead38e0be6c8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6e05161f70e828e8bd06ead38e0be6c8">&#9670;&nbsp;</a></span>Socket_getdata()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* Socket_getdata </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>socket</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>bytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>actual_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>rc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Attempts to read a number of bytes from a socket, non-blocking. </p>
<p>If a previous read did not finish, then retrieve that data. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>the socket to read from </td></tr>
    <tr><td class="paramname">bytes</td><td>the number of bytes to read </td></tr>
    <tr><td class="paramname">actual_len</td><td>the actual number of bytes read </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>completion code </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="Socket_8c_a6e05161f70e828e8bd06ead38e0be6c8_cgraph.png" border="0" usemap="#Socket_8c_a6e05161f70e828e8bd06ead38e0be6c8_cgraph" alt=""/></div>
<map name="Socket_8c_a6e05161f70e828e8bd06ead38e0be6c8_cgraph" id="Socket_8c_a6e05161f70e828e8bd06ead38e0be6c8_cgraph">
<area shape="rect" title="Attempts to read a number of bytes from a socket, non&#45;blocking." alt="" coords="5,132,119,159"/>
<area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="467,5,511,32"/>
<area shape="rect" href="Socket_8c.html#a47824ad5afba267b9488150e1f7e8610" title="Gets the specific error corresponding to SOCKET_ERROR." alt="" coords="216,12,312,39"/>
<area shape="rect" href="SocketBuffer_8c.html#a0d007b15408ae802c78bc69f115cf91e" title="A socket read has now completed so we can get rid of the queue." alt="" coords="185,132,343,159"/>
<area shape="rect" href="SocketBuffer_8c.html#a8a2e0c916232521098ff734d556c3b68" title="Get any queued data for a specific socket." alt="" coords="167,208,361,235"/>
<area shape="rect" href="SocketBuffer_8c.html#aaac8b43c1ab5d20eb8e6b95de6e80671" title="A socket read was interrupted so we need to queue data." alt="" coords="181,309,347,336"/>
<area shape="rect" href="LinkedList_8c.html#ab2bcc1897abf1d98490ea81c474dba52" title="Removes but does not free an item in a list by comparing the pointer to the content." alt="" coords="446,157,531,184"/>
<area shape="rect" href="LinkedList_8c.html#acad319e9ce896ff1fff30ddbeb06d22d" title="Finds an element in a list by comparing the content or pointer to the content." alt="" coords="807,221,901,248"/>
<area shape="rect" href="SocketBuffer_8c.html#acb4511a3a4767187a2607027aff718b8" title="Free the default queue memory." alt="" coords="411,56,567,83"/>
<area shape="rect" href="SocketBuffer_8c.html#acebc1cbb93be4588f33b04ed404f6dbf" title="List callback function for comparing socket_queues by socket." alt="" coords="433,208,544,235"/>
<area shape="rect" href="LinkedList_8c.html#ab82181e0c1d96954f82dee67cee41296" title="Removes and optionally frees an element in a list by comparing the content." alt="" coords="647,183,728,209"/>
<area shape="rect" href="LinkedList_8c.html#a7c6fba7f4b569c69829676bed2852ee9" title="Forward iteration through a list." alt="" coords="949,221,1068,248"/>
<area shape="rect" href="LinkedList_8c.html#abc7a28449893dfa775c2f709349968b4" title="Append an item to a list." alt="" coords="445,360,533,387"/>
<area shape="rect" href="SocketBuffer_8c.html#a9293d4ef45aa2a51baab9be4eb73091b" title="Create a new default queue when one has just been used." alt="" coords="409,411,568,437"/>
<area shape="rect" href="LinkedList_8c.html#a321a3598d6979c7af3f995b77ea2cec3" title="Append an already allocated ListElement and content to a list." alt="" coords="616,360,759,387"/>
</map>
</div>

</div>
</div>
<a id="a27952bf5cd133a873da9a218c7207059"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a27952bf5cd133a873da9a218c7207059">&#9670;&nbsp;</a></span>Socket_getpeer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* Socket_getpeer </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>sock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get information about the other end connected to a socket. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sock</td><td>the socket to inquire on </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the peer information </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="Socket_8c_a27952bf5cd133a873da9a218c7207059_cgraph.png" border="0" usemap="#Socket_8c_a27952bf5cd133a873da9a218c7207059_cgraph" alt=""/></div>
<map name="Socket_8c_a27952bf5cd133a873da9a218c7207059_cgraph" id="Socket_8c_a27952bf5cd133a873da9a218c7207059_cgraph">
<area shape="rect" title="Get information about the other end connected to a socket." alt="" coords="5,31,119,57"/>
<area shape="rect" href="Socket_8c.html#a47824ad5afba267b9488150e1f7e8610" title="Gets the specific error corresponding to SOCKET_ERROR." alt="" coords="191,5,287,32"/>
<area shape="rect" href="Socket_8c.html#a22feda106732e755b6f9e44e026bd261" title="Convert a numeric address to character string." alt="" coords="167,56,312,83"/>
<area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="360,5,404,32"/>
</map>
</div>

</div>
</div>
<a id="a2c082b4e794c0a7835a0700f0bc7b3a1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2c082b4e794c0a7835a0700f0bc7b3a1">&#9670;&nbsp;</a></span>Socket_getReadySocket()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Socket_getReadySocket </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>more_work</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct timeval *&#160;</td>
          <td class="paramname"><em>tp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">mutex_type&#160;</td>
          <td class="paramname"><em>mutex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>rc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the next socket ready for communications as indicated by select. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">more_work</td><td>flag to indicate more work is waiting, and thus a timeout value of 0 should be used for the select </td></tr>
    <tr><td class="paramname">tp</td><td>the timeout to be used for the select, unless overridden </td></tr>
    <tr><td class="paramname">rc</td><td>a value other than 0 indicates an error of the returned socket </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the socket next ready, or 0 if none is ready </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="Socket_8c_a2c082b4e794c0a7835a0700f0bc7b3a1_cgraph.png" border="0" usemap="#Socket_8c_a2c082b4e794c0a7835a0700f0bc7b3a1_cgraph" alt=""/></div>
<map name="Socket_8c_a2c082b4e794c0a7835a0700f0bc7b3a1_cgraph" id="Socket_8c_a2c082b4e794c0a7835a0700f0bc7b3a1_cgraph">
<area shape="rect" title="Returns the next socket ready for communications as indicated by select." alt="" coords="5,107,171,133"/>
<area shape="rect" href="Socket_8c.html#aeec7592039c180d20ef7c6e8f50d5667" title="Don&#39;t accept work from a client unless it is accepting work back, i.e." alt="" coords="252,81,320,108"/>
<area shape="rect" href="Thread_8c.html#a7e92185eb22775c76e1b6b8865468f17" title="Lock a mutex which has alrea." alt="" coords="219,132,353,159"/>
<area shape="rect" href="LinkedList_8c.html#a1738915a6d6f10022e9ee1481c0ae452" title="List callback function for comparing integers." alt="" coords="617,56,704,83"/>
<area shape="rect" href="LinkedList_8c.html#acad319e9ce896ff1fff30ddbeb06d22d" title="Finds an element in a list by comparing the content or pointer to the content." alt="" coords="752,107,847,133"/>
<area shape="rect" href="LinkedList_8c.html#a4bb7c34fe9a5832d65f530091e0fad0d" title="Removes and frees an element in a list by comparing the content." alt="" coords="426,157,545,184"/>
<area shape="rect" href="Socket_8c.html#ae95673b434f2c489ecefe4688c80be2d" title="Indicate whether any data is pending outbound for a socket." alt="" coords="401,5,569,32"/>
<area shape="rect" href="LinkedList_8c.html#a7c6fba7f4b569c69829676bed2852ee9" title="Forward iteration through a list." alt="" coords="895,107,1013,133"/>
<area shape="rect" href="LinkedList_8c.html#ab82181e0c1d96954f82dee67cee41296" title="Removes and optionally frees an element in a list by comparing the content." alt="" coords="620,157,701,184"/>
</map>
</div>

</div>
</div>
<a id="acb965ef2124fa6736477c9286f7599b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acb965ef2124fa6736477c9286f7599b2">&#9670;&nbsp;</a></span>Socket_new()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Socket_new </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>addr_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>sock</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a new socket and TCP connect to an address/port. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">addr</td><td>the address string </td></tr>
    <tr><td class="paramname">port</td><td>the TCP port </td></tr>
    <tr><td class="paramname">sock</td><td>returns the new socket </td></tr>
    <tr><td class="paramname">timeout</td><td>the timeout in milliseconds </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>completion code </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="Socket_8c_acb965ef2124fa6736477c9286f7599b2_cgraph.png" border="0" usemap="#Socket_8c_acb965ef2124fa6736477c9286f7599b2_cgraph" alt=""/></div>
<map name="Socket_8c_acb965ef2124fa6736477c9286f7599b2_cgraph" id="Socket_8c_acb965ef2124fa6736477c9286f7599b2_cgraph">
<area shape="rect" title="Create a new socket and TCP connect to an address/port." alt="" coords="5,208,100,235"/>
<area shape="rect" href="LinkedList_8c.html#abc7a28449893dfa775c2f709349968b4" title="Append an item to a list." alt="" coords="359,5,447,32"/>
<area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="819,259,863,285"/>
<area shape="rect" href="Socket_8c.html#a3c690a1d23a55ccf1ea52cdea9b56432" title="Add a socket to the list of socket to check with select." alt="" coords="148,107,280,133"/>
<area shape="rect" href="Socket_8c.html#a6bdb051c5944e1a0fd16ba18544ab5df" title="Close a socket and remove it from the select list." alt="" coords="163,385,265,412"/>
<area shape="rect" href="Socket_8c.html#a47824ad5afba267b9488150e1f7e8610" title="Gets the specific error corresponding to SOCKET_ERROR." alt="" coords="571,259,667,285"/>
<area shape="rect" href="LinkedList_8c.html#a321a3598d6979c7af3f995b77ea2cec3" title="Append an already allocated ListElement and content to a list." alt="" coords="547,5,690,32"/>
<area shape="rect" href="LinkedList_8c.html#a1738915a6d6f10022e9ee1481c0ae452" title="List callback function for comparing integers." alt="" coords="359,157,446,184"/>
<area shape="rect" href="LinkedList_8c.html#acad319e9ce896ff1fff30ddbeb06d22d" title="Finds an element in a list by comparing the content or pointer to the content." alt="" coords="1100,537,1195,564"/>
<area shape="rect" href="LinkedList_8c.html#a7c6fba7f4b569c69829676bed2852ee9" title="Forward iteration through a list." alt="" coords="1243,639,1361,665"/>
<area shape="rect" href="LinkedList_8c.html#a4bb7c34fe9a5832d65f530091e0fad0d" title="Removes and frees an element in a list by comparing the content." alt="" coords="782,512,901,539"/>
<area shape="rect" href="Socket_8c.html#ad246851be3980fd316d16864a786c808" title="Continue an outstanding write for a particular socket." alt="" coords="338,411,467,437"/>
<area shape="rect" href="Socket_8c.html#a2e7c21836cd061947d6d6e28446c4a59" title="Close a socket without removing it from the select list." alt="" coords="337,309,468,336"/>
<area shape="rect" href="SocketBuffer_8c.html#a0601e12cab5b7c4777df10ca6d38a41b" title="Cleanup any buffers for a specific socket." alt="" coords="328,563,477,589"/>
<area shape="rect" href="LinkedList_8c.html#ab82181e0c1d96954f82dee67cee41296" title="Removes and optionally frees an element in a list by comparing the content." alt="" coords="971,537,1052,564"/>
<area shape="rect" href="SocketBuffer_8c.html#a5f22a1ac450cb1805e2ab8f2ae3da80e" title="Get any queued write data for a specific socket." alt="" coords="543,411,695,437"/>
<area shape="rect" href="SocketBuffer_8c.html#a39f1ee9c98bc12a7be4d7a40b03550d5" title="List callback function for comparing pending_writes by socket." alt="" coords="760,461,923,488"/>
<area shape="rect" href="LinkedList_8c.html#a8430370b2b15c56ec95bb8e7e36753a5" title="Removes and frees an item in a list by comparing the pointer to the content." alt="" coords="795,563,887,589"/>
<area shape="rect" href="SocketBuffer_8c.html#a893ce45cf77f7d66c3f27c831ccf8124" title="A socket write has now completed so we can get rid of the queue." alt="" coords="525,512,712,539"/>
<area shape="rect" href="SocketBuffer_8c.html#acebc1cbb93be4588f33b04ed404f6dbf" title="List callback function for comparing socket_queues by socket." alt="" coords="563,613,674,640"/>
</map>
</div>

</div>
</div>
<a id="ae95673b434f2c489ecefe4688c80be2d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae95673b434f2c489ecefe4688c80be2d">&#9670;&nbsp;</a></span>Socket_noPendingWrites()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Socket_noPendingWrites </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>socket</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Indicate whether any data is pending outbound for a socket. </p>
<dl class="section return"><dt>Returns</dt><dd>boolean - true == data pending. </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="Socket_8c_ae95673b434f2c489ecefe4688c80be2d_cgraph.png" border="0" usemap="#Socket_8c_ae95673b434f2c489ecefe4688c80be2d_cgraph" alt=""/></div>
<map name="Socket_8c_ae95673b434f2c489ecefe4688c80be2d_cgraph" id="Socket_8c_ae95673b434f2c489ecefe4688c80be2d_cgraph">
<area shape="rect" title="Indicate whether any data is pending outbound for a socket." alt="" coords="5,31,173,57"/>
<area shape="rect" href="LinkedList_8c.html#a1738915a6d6f10022e9ee1481c0ae452" title="List callback function for comparing integers." alt="" coords="225,5,312,32"/>
<area shape="rect" href="LinkedList_8c.html#acad319e9ce896ff1fff30ddbeb06d22d" title="Finds an element in a list by comparing the content or pointer to the content." alt="" coords="221,56,316,83"/>
<area shape="rect" href="LinkedList_8c.html#a7c6fba7f4b569c69829676bed2852ee9" title="Forward iteration through a list." alt="" coords="364,56,483,83"/>
</map>
</div>

</div>
</div>
<a id="a601ba77d9b01e908dbd0653f6efa3be0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a601ba77d9b01e908dbd0653f6efa3be0">&#9670;&nbsp;</a></span>Socket_putdatas()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Socket_putdatas </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>socket</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>buf0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>buf0len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structPacketBuffers.html">PacketBuffers</a>&#160;</td>
          <td class="paramname"><em>bufs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Attempts to write a series of buffers to a socket in <em>one</em> system call so that they are sent as one packet. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>the socket to write to </td></tr>
    <tr><td class="paramname">buf0</td><td>the first buffer </td></tr>
    <tr><td class="paramname">buf0len</td><td>the length of data in the first buffer </td></tr>
    <tr><td class="paramname">count</td><td>number of buffers </td></tr>
    <tr><td class="paramname">buffers</td><td>an array of buffers to write </td></tr>
    <tr><td class="paramname">buflens</td><td>an array of corresponding buffer lengths </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>completion code, especially TCPSOCKET_INTERRUPTED </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="Socket_8c_a601ba77d9b01e908dbd0653f6efa3be0_cgraph.png" border="0" usemap="#Socket_8c_a601ba77d9b01e908dbd0653f6efa3be0_cgraph" alt=""/></div>
<map name="Socket_8c_a601ba77d9b01e908dbd0653f6efa3be0_cgraph" id="Socket_8c_a601ba77d9b01e908dbd0653f6efa3be0_cgraph">
<area shape="rect" title="Attempts to write a series of buffers to a socket in one system call so that they are sent as one pac..." alt="" coords="5,107,125,133"/>
<area shape="rect" href="LinkedList_8c.html#abc7a28449893dfa775c2f709349968b4" title="Append an item to a list." alt="" coords="404,5,492,32"/>
<area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="593,183,637,209"/>
<area shape="rect" href="Socket_8c.html#ae95673b434f2c489ecefe4688c80be2d" title="Indicate whether any data is pending outbound for a socket." alt="" coords="179,107,347,133"/>
<area shape="rect" href="Socket_8c.html#aec4ee8ecb248d29d315d2624a88ed1c3" title="Attempts to write a series of iovec buffers to a socket in one system call so that they are sent as o..." alt="" coords="210,208,315,235"/>
<area shape="rect" href="SocketBuffer_8c.html#a9a92acaaec423c44227e3dd978223529" title="A socket write was interrupted so store the remaining data." alt="" coords="173,5,352,32"/>
<area shape="rect" href="LinkedList_8c.html#a321a3598d6979c7af3f995b77ea2cec3" title="Append an already allocated ListElement and content to a list." alt="" coords="544,5,687,32"/>
<area shape="rect" href="LinkedList_8c.html#a1738915a6d6f10022e9ee1481c0ae452" title="List callback function for comparing integers." alt="" coords="405,107,491,133"/>
<area shape="rect" href="LinkedList_8c.html#acad319e9ce896ff1fff30ddbeb06d22d" title="Finds an element in a list by comparing the content or pointer to the content." alt="" coords="401,56,495,83"/>
<area shape="rect" href="LinkedList_8c.html#a7c6fba7f4b569c69829676bed2852ee9" title="Forward iteration through a list." alt="" coords="556,56,675,83"/>
<area shape="rect" href="Socket_8c.html#a47824ad5afba267b9488150e1f7e8610" title="Gets the specific error corresponding to SOCKET_ERROR." alt="" coords="400,208,496,235"/>
</map>
</div>

</div>
</div>
<a id="a90f49db5a5763c6874f27facfe9e60a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a90f49db5a5763c6874f27facfe9e60a3">&#9670;&nbsp;</a></span>Socket_setnonblocking()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Socket_setnonblocking </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>sock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set a socket non-blocking, OS independently. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sock</td><td>the socket to set non-blocking </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TCP call error code </dd></dl>

</div>
</div>
<a id="aec4ee8ecb248d29d315d2624a88ed1c3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aec4ee8ecb248d29d315d2624a88ed1c3">&#9670;&nbsp;</a></span>Socket_writev()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Socket_writev </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>socket</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">iobuf *&#160;</td>
          <td class="paramname"><em>iovecs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>count</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long *&#160;</td>
          <td class="paramname"><em>bytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Attempts to write a series of iovec buffers to a socket in <em>one</em> system call so that they are sent as one packet. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>the socket to write to </td></tr>
    <tr><td class="paramname">iovecs</td><td>an array of buffers to write </td></tr>
    <tr><td class="paramname">count</td><td>number of buffers in iovecs </td></tr>
    <tr><td class="paramname">bytes</td><td>number of bytes actually written returned </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>completion code, especially TCPSOCKET_INTERRUPTED </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="Socket_8c_aec4ee8ecb248d29d315d2624a88ed1c3_cgraph.png" border="0" usemap="#Socket_8c_aec4ee8ecb248d29d315d2624a88ed1c3_cgraph" alt=""/></div>
<map name="Socket_8c_aec4ee8ecb248d29d315d2624a88ed1c3_cgraph" id="Socket_8c_aec4ee8ecb248d29d315d2624a88ed1c3_cgraph">
<area shape="rect" title="Attempts to write a series of iovec buffers to a socket in one system call so that they are sent as o..." alt="" coords="5,5,111,32"/>
<area shape="rect" href="Socket_8c.html#a47824ad5afba267b9488150e1f7e8610" title="Gets the specific error corresponding to SOCKET_ERROR." alt="" coords="159,5,255,32"/>
<area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="303,5,347,32"/>
</map>
</div>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon May 24 2021 18:05:54 for MQTT C Client Libraries Internals by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
